/**
 * 我的银行卡页面
 * author wim
 */
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_easyrefresh/material_footer.dart';
import 'package:flutter_easyrefresh/material_header.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:panda/base/Constant.dart';
import 'package:panda/set/AddBank.dart';

class MyBankPage extends StatefulWidget {
  MyBankPage({Key key}) : super(key: key);

  @override
  _MyBankPageState createState() => _MyBankPageState();
}

class _MyBankPageState extends State<MyBankPage> {
  EasyRefreshController _controller = EasyRefreshController();
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: new AppBar(
        title: new Text(
          "我的银行卡",
          style: TextStyle(
              fontSize: ScreenUtil.getInstance().setSp(BIG_FONT_SIZE),
              color: Colors.black),
        ),
        elevation: 0.2,
        backgroundColor: Colors.white,
        brightness: Brightness.light,
        centerTitle: true,
        iconTheme: new IconThemeData(color: Colors.black),
      ),
      body: Container(
        child: new Column(
          children: <Widget>[
            Expanded(
              flex: 1,
              child: EasyRefresh(
                controller: _controller,
                enableControlFinishRefresh: true,
                header: MaterialHeader(),
                footer: MaterialFooter(),
                onRefresh: () {},
                child: Text('data'),
              ),
            ),
            new Container(
              width: double.infinity,
              height: ScreenUtil.getInstance().setHeight(DP_80),
              margin: EdgeInsets.all(ScreenUtil.getInstance().setHeight(DP_80)),
              decoration: new BoxDecoration(
                  border: Border.all(color: mainColor, width: 1),
                  borderRadius: BorderRadius.circular(5)),
              padding: EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 0.0),
              child: new FlatButton(
                child: new Padding(
                  padding: EdgeInsets.all(0.0),
                  child: new Text(
                    "+  添加银行卡",
                    style: new TextStyle(
                        color: mainColor,
                        fontSize:
                            ScreenUtil.getInstance().setSp(NORMAL_FONT_SIZE)),
                  ),
                ),
                onPressed: () {
                  Navigator.of(context)
                      .push(new MaterialPageRoute(builder: (context) {
                    return new AddBankPage();
                  }));
                },
              ),
            )
          ],
        ),
      ),
    );
  }
}
